﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Client_Web.ServiceReference;

namespace Client_Web
{
    public partial class UserList : System.Web.UI.Page
    {
        protected List<UserStruct> userList;

        protected void Page_Load(object sender, EventArgs e)
        {
            ServiceClient serviceClient = new ServiceClient();
            string[] userStringList = serviceClient.getUserList();

            userList = new List<UserStruct>();
            for (int i = 1; i < userStringList.Length; i++)
            {
                string[] data = Util.CleanAndSplit(userStringList[i]);

                UserStruct user = new UserStruct();
                user.id = data[0];
                user.name = data[1];
                user.login = data[2];
                userList.Add(user);
            }

            Title = "Liste des utilisateurs";
        }
    }
}